#ifndef __CTS_H__
#define __CTS_H__
#include <stdio.h>
#include <string.h>
#include <iostream>

#define TS_SIZE 188
#define ERROR_PROBABILITY 5

class CTS{

public:
	CTS(const char* chArray);
	~CTS(void);

	const char* getPayload();
    unsigned int getHeaderLength();
	unsigned int getPayloadLength();
    unsigned int getAdaptationFieldControl();
    unsigned int getPayloadStartIndicator();
    unsigned int getPID();
    unsigned int getContinuityCounter();
	
	bool isNextTo(int ContinuityCounter);

	void setError();

    char* getData();
	char m_data[188];
private:

	void _parseTsHeader();

	//unsigned int sync_byte : 8;
	//int transport_priority : 1;
	//int payload_unit_start_indicator : 1; 
	//int transport_error_indicator : 1 ;
	//int PID : 13;    
	//unsigned int continuity_counter:4;
	//unsigned int adaptation_field_control:2; 
	//unsigned int transport_scrambling_control:2;
	unsigned int m_continuity_counter;
	unsigned int m_PID;
	unsigned int m_payload_unit_start_indicator;
	unsigned int m_adaptation_field_control;
    int m_headerLength;
};
#endif //__CTS_H__